
package ttu.idu0080.courierService_client;

/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import javax.xml.namespace.QName;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

/**
 * This class was generated by Apache CXF 2.5.2
 * 2012-05-14T12:03:27.983+03:00
 * Generated source version: 2.5.2
 * 
 */
public final class CourierService_CourierServicePort_Client {

    private static final QName SERVICE_NAME = new QName("http://server.order.idu0080.ttu/", "CourierServiceService");

    public CourierService_CourierServicePort_Client() {
    }

    public List<Courier> getAllCouriers() throws java.lang.Exception {
        URL wsdlURL = CourierServiceService.WSDL_LOCATION;
        List<Courier> courierList=null;
        String[] args={""};
        if (args.length > 0 && args[0] != null && !"".equals(args[0])) { 
            File wsdlFile = new File(args[0]);
            try {
                if (wsdlFile.exists()) {
                    wsdlURL = wsdlFile.toURI().toURL();
                } else {
                    //wsdlURL = new URL(args[0]);
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
        }
      
        CourierServiceService ss = new CourierServiceService(wsdlURL, SERVICE_NAME);
        CourierService port = ss.getCourierServicePort();  
        
        {
        System.out.println("Invoking getAllCouriers...");
        courierList=port.getAllCouriers();

        return courierList;
        }

    }
    public Courier getCourierByID(int courier_id) throws java.lang.Exception {
        URL wsdlURL = CourierServiceService.WSDL_LOCATION;
        Courier courier=null;
        String[] args={""};
        if (args.length > 0 && args[0] != null && !"".equals(args[0])) { 
            File wsdlFile = new File(args[0]);
            try {
                if (wsdlFile.exists()) {
                    wsdlURL = wsdlFile.toURI().toURL();
                } else {
                    //wsdlURL = new URL(args[0]);
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
        }
      
        CourierServiceService ss = new CourierServiceService(wsdlURL, SERVICE_NAME);
        CourierService port = ss.getCourierServicePort();  
        
        {
        System.out.println("Invoking getAllCouriers...");
        courier=port.getCourierById(courier_id);

        return courier;
        }

    }
}
